package com.tim.third;

import org.openjdk.jol.info.ClassLayout;

import java.util.Date;

/**
 * 分析对象布局工具
 * jol
 * https://gitee.com/JackChen2/jol
 *
 */
public class JolUtils {
    public static void main(String[] args) throws Exception {
        layout(new Date());
    }

    /**对象内存布局*/
    public static void layout(Object object) {
        // 打印obj对象头
        String str = ClassLayout.parseInstance(object).toPrintable();
        System.out.println(str);
    }

    
}
